package org.adultedu.service.serviceimpl;

import org.adultedu.dao.StudentMapper;
import org.adultedu.pojo.Student;
import org.adultedu.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Transactional
@Service("StudentServiceImpl")
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentMapper studentMapper;

    public List<Student> queryAllStudent() {
        return studentMapper.queryAllStudent();
    }

    public List<Student> queryUniqueStudent(Student student) {
        return studentMapper.queryUniqueStudent(student);
    }

    public List<Student> queryLimitStudent(String name, String sfz, String tele, String email,Integer currentsize,Integer pagesize) {
        return studentMapper.queryLimitStudent(name,sfz,tele,email,currentsize,pagesize);
    }

    public Integer getStuNum(String name, String sfz, String tele, String email) {
        return studentMapper.getStuNum(name,sfz,tele,email);
    }

    public int updateStudent(Student student) { return studentMapper.updateStudent(student);
    }

    public int insertStudent(Student student) {
        return studentMapper.insertStudent(student);
    }

    public int deleteStudent(String sid) {
        return studentMapper.deleteStudent(sid);
    }

    public String getSfzBySid(String sid) {
        return studentMapper.getSfzBySid(sid);
    }

    public int resetStudentAccount(String sid,String pwd) {
        return studentMapper.resetStudentAccount(sid,pwd);
    }

    public int disableAccount(String sid,String reason,String other) {
        return studentMapper.disableAccount(sid,reason,other);
    }

    public int enableAccount(String sid) {
        return studentMapper.enableAccount(sid);
    }

    public List getSaleStudent(String cid) {
        return studentMapper.getSaleStudent(cid);
    }
}
